#ifndef __BSP_TIMER_H
#define __BSP_TIMER_H

#include "gd32f4xx_timer.h"
#include <stdint.h>   

#define ENCODER_TIM_PSC  0               /*计数器分频*/
#define ENCODER_TIM_PERIOD  65535        /*计数器最大值*/

#define ENCODER_COUNT TIMER_CNT(TIMER2)  /* 编码器数值 */
#define ENCODER_DIR   (TIMER_CTL0(TIMER2)&TIMER_CTL0_DIR)==TIMER_CTL0_DIR /* 编码器方向 */

extern void bsp_timer1_init(void);
extern void bsp_timer2_init(void);

#endif
